#ifndef TORUS_H
#define TORUS_H

#include <QtOpenGL>
#include <QVector>
#include <QVarLengthArray>
#include <glm/glm.hpp>

#define _USE_MATH_DEFINES
#include <cmath>
#include "Primitive.h"
#include "MyVertex.h"
#define BUFFER_OFFSET(i) ((GLbyte *)NULL + (i))

namespace CAD_CAM
{
	class Torus: public Primitive
	{
	public:
		Torus(int vertices = 20, int stripes = 20, double smallRadius = 0.5, double bigRadius = 1.5);
		~Torus();
		void DrawShader(QGLShaderProgram& shaderProgram, QMatrix4x4& viewMatrix, QMatrix4x4& projectionMatrix);
	
		//void rotate(float angle, QVector3D vector);
		//void rotate(float angle, float x, float y, float z);
		//void translate(QVector3D vector);
		//void translate(float x, float y, float z);
		//void scale(QVector3D scale);
		//void setSize(QVector3D size);

		int numVertices, numStripes;

		float getBigRadius() { return R; };
		float getSmallRadius() { return r; };

	public slots:
		void setWidth(double width);
		void setHeight(double height);
		void setLength(double length);
		void setBigRadius(float bigRadius);
		void setSmallRadius(float smallRadius);

	private:
		float r, R;
		// ----- methods
		void buildTorus(MyVertex* verticesArray, QVector<GLuint> & indicesArray);
	};
}
#endif // TORUS_H
